
// ChildView.cpp : implementation of the CChildView class
//

#include "stdafx.h"
#include "ScaleTest.h"
#include "ChildView.h"
#include <math.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CChildView

CChildView::CChildView()
{
}

CChildView::~CChildView()
{
}


BEGIN_MESSAGE_MAP(CChildView, CWnd)
	ON_WM_PAINT()
END_MESSAGE_MAP()



// CChildView message handlers

BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs) 
{
	if (!CWnd::PreCreateWindow(cs))
		return FALSE;

	cs.dwExStyle |= WS_EX_CLIENTEDGE;
	cs.style &= ~WS_BORDER;
	cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS, 
		::LoadCursor(NULL, IDC_ARROW), reinterpret_cast<HBRUSH>(COLOR_WINDOW+1), NULL);

	return TRUE;
}

void CChildView::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	// TODO: Add your message handler code here
	
	// Do not call CWnd::OnPaint() for painting messages
	int w = 352.0*pow(8,1.0/3.0);
	int h = 256.0*pow(8,1.0/3.0);
	Bitmap* bitmap1 = Bitmap::FromFile(L"D:\\play with maps\\Q46121G7\\maplet1.jpg");
	Bitmap* bitmap2 = Bitmap::FromFile(L"D:\\play with maps\\Q46121G7\\maplet2.jpg");
	Graphics g(dc);
	g.DrawImage(bitmap1, Rect(0,0,w,h), 0, 0, 352, 256, UnitPixel);
	g.DrawImage(bitmap2, Rect(w,0,w,h), 0, 0, 352, 256, UnitPixel);
}

